UXL Utilities ![npm version](https://badge.fury.io/js/%40uxland%2Futilities.svg)
Build Status | Statements | Branches | Functions | Lines |
---|
![Building Status BuildStatus](#buildstatus#) | ![Make me better! Statements](#statements#) | ![Make me better! Branches](#branches#) | ![Make me better! Functions](#functions#) | ![Make me better! Lines](#lines#) |
Installation
npm i @uxland/utilities
Usage
Collect
Returns nested object value and prototype from provided key.
collect("foo", "foo");
collect({ foo: "bar" });
collect({ foo: { bar: "qux" } });
Constant Builder
Converts a string to a new one with provided prefix and suffix in builder
constantBuilder("PREFIX")("CONSTANT");
constantBuilder("PREFIX", "SUFFIX")("CONSTANT");
constantBuilder("PREFIX", "SUFFIX", "$$")("CONSTANT");
Invariant
Check if condition is fulfilled, otherwise throws supplied message error
invariant(R.is("number")(3), "Supplied value is not a number");
invariant(R.is("number")("3"), "Supplied value is not a number");
No operation
Defines an empty function
nop();